#include "stdafx.h"
#include "Lock.h"


Lock::Lock(void)
{
	//初始化临界资源
	InitializeCriticalSection(&(this->cs));
}


Lock::~Lock()
{
	//删除临界资源
	DeleteCriticalSection(&(this->cs));
}

void Lock::lockUp()
{
	//临界资源加锁
	EnterCriticalSection(&(this->cs));
}

void Lock::unLock()
{
	//离开临界资源去除锁
	LeaveCriticalSection(&(this->cs));
}
